home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 1 / Eagles_Nest_Mac_Collection_Disc_1.TOAST / HyperCard & XCMD⁄XFCN / HamTechTest4 / Technician Ham Test / card_87597.txt < prev    next >
Text File  |  1993-04-11  |  6KB  |  260 lines

  1. -- card: 87597 from stack: in
  2. -- bmap block id: 95915
  3. -- flags: 4000
  4. -- background id: 95451
  5. -- name: report
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global immediate,questlist,questkey,questans,firstentry
  9.   --** if necessary to save this card, copy card, rename by adding
  10.   --** "_name" to end of card name, then delete from here down to --**
  11.   set the cursor to 4
  12.   put false into immediate
  13.   put the long time into field "stop"
  14.   put empty into score
  15.   put empty into field qmissed
  16.   repeat with i=1 to number of items of questlist
  17.     if item i of questans = item i of questkey then
  18.       add 1 to score
  19.     else
  20.       put field qmissed & i & "," into field qmissed
  21.       --put field qmissed & item i of questlist & "," into field qmissed
  22.     end if
  23.   end repeat
  24.   set lockscreen to true
  25.  
  26.   delete last character of field qmissed
  27.   --** and put correct score in next line (and uncomment)
  28.   --** put 22 into score -- replace 22 with correct score
  29.   --** also copy card savedscores, rename by adding "_name", and
  30.   --** edit script for the print button to call correct card names
  31.   if score is empty then put "0" into field "correct"
  32.   else put score into field "correct"
  33.   put the number of items of questlist into field "Q#"
  34.  
  35.   if field "Q#" > 0 then
  36.     put score*100/field "Q#" & "%" into field "Percent"
  37.     put score*100/field "Q#" into foo
  38.   else
  39.     put "0%" into field "Percent"
  40.     put "0" into foo
  41.   end if
  42.  
  43.   if foo >= 90 then play applause
  44. end opencard
  45.  
  46. on build_savedscores
  47.   global questlist,questans
  48.   global username
  49.   put empty into savedscore1
  50.   put empty into savedscore2
  51.   put empty into savedscore3
  52.   repeat with i=1 to number of items of questlist
  53.     if i < 18 then
  54.       put savedscore1&item i of questans&return into savedscore1
  55.     else if i < 35 then
  56.       put savedscore2&item i of questans&return into savedscore2
  57.     else
  58.       put savedscore3&item i of questans&return into savedscore3
  59.     end if
  60.   end repeat
  61.  
  62.   go card savedscores
  63.   put username into cd field name
  64.   put the date into cd field date
  65.   put savedscore1 into field ans1
  66.   put savedscore2 into field ans2
  67.   put savedscore3 into field ans3
  68. end build_savedscores
  69.  
  70. on savesc
  71.   global username
  72.   doMenu "Copy Card"
  73.   doMenu "Paste Card"
  74.   set name of this card  to "report_" & username
  75.   set cantDelete of this card to false
  76.   set the script of this card to empty
  77.   set the script of button "save scores" to empty
  78.   set the script of button "Print Score" to empty
  79.   build_savedscores
  80.   doMenu "Copy Card"
  81.   doMenu "Paste Card"
  82.   set name of this card  to "savedscores_" & username
  83.   set cantDelete of this card to false
  84.   set the script of this card to empty
  85.   show  button "Delete Saved"
  86.   show  button "Print Score"
  87.   go card report
  88. end savesc
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. -- part 2 (button)
  96. -- low flags: 00
  97. -- high flags: A003
  98. -- rect: left=192 top=296 right=323 bottom=234
  99. -- title width / last selected line: 0
  100. -- icon id / first selected line: 0 / 0
  101. -- text alignment: 1
  102. -- font id: 0
  103. -- text size: 12
  104. -- style flags: 0
  105. -- line height: 16
  106. -- part name: yes
  107. ----- HyperTalk script -----
  108. on mouseUp
  109.   global questlist -- question # option
  110.   if field qmissed of card report is empty then
  111.     answer "Perfect score! No need to review." with "OK"
  112.     exit mouseUp
  113.   end if
  114.   put field qmissed of card report into numWrong
  115.   repeat with x=1 to the number of items of numWrong
  116.     put empty into field qmissed of card report
  117.     get item x of numWrong
  118.     get item it of questlist -- only required for question # option
  119.     go card it
  120.     reView
  121.   end repeat
  122.   go card report
  123.   put numWrong into field qmissed of card report
  124. end mouseUp
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. -- part 3 (button)
  141. -- low flags: 00
  142. -- high flags: A003
  143. -- rect: left=240 top=296 right=323 bottom=334
  144. -- title width / last selected line: 0
  145. -- icon id / first selected line: 0 / 0
  146. -- text alignment: 1
  147. -- font id: 0
  148. -- text size: 12
  149. -- style flags: 0
  150. -- line height: 16
  151. -- part name: no, new test
  152. ----- HyperTalk script -----
  153. on mouseUp
  154.   global score,lockkey
  155.   put empty into field "QMissed"
  156.   put empty into score
  157.   put false into lockkey
  158.   go first card
  159. end mouseUp
  160.  
  161.  
  162.  
  163.  
  164.  
  165. -- part 4 (button)
  166. -- low flags: 00
  167. -- high flags: A000
  168. -- rect: left=413 top=290 right=334 bottom=492
  169. -- title width / last selected line: 0
  170. -- icon id / first selected line: 1007 / 1007
  171. -- text alignment: 1
  172. -- font id: 0
  173. -- text size: 12
  174. -- style flags: 0
  175. -- line height: 16
  176. -- part name: Print Score
  177. ----- HyperTalk script -----
  178. on mouseUp
  179.   lock screen
  180.   open printing
  181.   print this card
  182.   put field QMissed&"," into field QMissed
  183.   build_savedscores
  184.   print this card
  185.   close printing
  186.   go card report
  187.   unlock screen
  188. end mouseUp
  189.  
  190.  
  191.  
  192. -- part 6 (button)
  193. -- low flags: 00
  194. -- high flags: 0000
  195. -- rect: left=363 top=295 right=332 bottom=401
  196. -- title width / last selected line: 0
  197. -- icon id / first selected line: 21700 / 21700
  198. -- text alignment: 1
  199. -- font id: 0
  200. -- text size: 12
  201. -- style flags: 0
  202. -- line height: 16
  203. -- part name: Home
  204. ----- HyperTalk script -----
  205. on mouseUp
  206.   visual effect iris close
  207.   go home
  208. end mouseUp
  209.  
  210.  
  211.  
  212.  
  213. -- part 12 (button)
  214. -- low flags: 00
  215. -- high flags: A000
  216. -- rect: left=421 top=133 right=189 bottom=487
  217. -- title width / last selected line: 0
  218. -- icon id / first selected line: 12451 / 12451
  219. -- text alignment: 1
  220. -- font id: 0
  221. -- text size: 12
  222. -- style flags: 0
  223. -- line height: 16
  224. -- part name: save scores
  225. ----- HyperTalk script -----
  226. on mouseUp
  227.   global username
  228.   put "This will create card savedscores_" & username into foo
  229.   answer foo with "OK" or "Cancel"
  230.   if it is "Cancel" then
  231.     exit mouseUp
  232.   end if
  233.   get userlevel
  234.   put it into savelevel
  235.   set the userlevel to 5
  236.   savesc
  237.   set the userlevel to savelevel
  238. end mouseUp
  239.  
  240.  
  241.  
  242. -- part contents for background part 1
  243. ----- text -----
  244. 10:21:39 AM
  245.  
  246. -- part contents for background part 2
  247. ----- text -----
  248. 10:26:33 AM
  249.  
  250. -- part contents for background part 3
  251. ----- text -----
  252. 22
  253.  
  254. -- part contents for background part 4
  255. ----- text -----
  256. 25
  257.  
  258. -- part contents for background part 5
  259. ----- text -----
  260. 88%